package main.java.game.combatant;

import main.java.game.Card;


/**
 * @author   ILDiNHo
 */
public class Combatant extends Card {
	
	public Combatant(String name, Integer init, Integer lifepoints, Integer defense, Integer attack){
		super(name);
		this.init = init;
		this.lifePoints = lifepoints;
		this.defense = defense;
		this.attack = attack;
		this.name=name;
		this.initialLifePoints=lifepoints;
		this.setInitialAttack(attack);
		this.setInitialDefense(defense);
		this.setInitialInit(init);
		
		
	}

	private Integer initialDefense;
	private Integer initialAttack;
	private Integer initialInit;
	private Boolean blockedRegeneration=false;
	/**
	 * @uml.property  name="init"
	 */
	private Integer init;
	/**
	 * @uml.property  name="name"
	 */
	private String name;
	
	/**
	 * @return
	 * @uml.property  name="name"
	 */
	public String getName(){
		return name;
	}

	/**
	 * Getter of the property <tt>init</tt>
	 * @return  Returns the init.
	 * @uml.property  name="init"
	 */
	public Integer getInit() {
		return init;
	}

	/**
	 * Setter of the property <tt>init</tt>
	 * @param init  The init to set.
	 * @uml.property  name="init"
	 */
	public void setInit(Integer init) {
		this.init = init;
	}

	/**
	 * @uml.property  name="lifepoints"
	 */
	private Integer lifePoints;

	/**
	 * Getter of the property <tt>lifepoints</tt>
	 * @return  Returns the lifepoints.
	 * @uml.property  name="lifepoints"
	 */
	public Integer getLifepoints() {
		return lifePoints;
	}

	/**
	 * Setter of the property <tt>lifepoints</tt>
	 * @param lifepoints  The lifepoints to set.
	 * @uml.property  name="lifepoints"
	 */
	public void setLifepoints(Integer lifePoints) {
		if(!this.getBlockedRegeneration())
			this.lifePoints = lifePoints;
		else
			if(lifePoints<this.getLifepoints()){
				this.lifePoints = lifePoints;
			}
			
	}

	/**
	 * @uml.property  name="defense"
	 */
	private Integer defense;

	/**
	 * Getter of the property <tt>defense</tt>
	 * @return  Returns the defense.
	 * @uml.property  name="defense"
	 */
	public Integer getDefense() {
		return defense;
	}

	/**
	 * Setter of the property <tt>defense</tt>
	 * @param defense  The defense to set.
	 * @uml.property  name="defense"
	 */
	public void setDefense(Integer defense) {
		this.defense = defense;
	}

	
	private Integer attack;
	/**
	 * @uml.property  name="initialLifePoints"
	 */
	private Integer initialLifePoints;

	/**
	 * Getter of the property <tt>attack</tt>
	 * @return  Returns the attack.
	 * @uml.property  name="attacke"
	 */
	public Integer getAttack() {
		return attack;
	}

	/**
	 * Setter of the property <tt>attack</tt>
	 * @param defense  The defense to set.
	 * @uml.property  name="attack"
	 */
	public void setAttack(Integer attack) {
		this.attack = attack;
	}

	/**
	 * @return
	 * @uml.property  name="initialLifePoints"
	 */
	public Integer getInitialLifePoints() {
		// TODO Auto-generated method stub
		return initialLifePoints;
	}

	public void setInitialAttack(Integer initialAttack) {
		this.initialAttack = initialAttack;
	}

	public Integer getInitialAttack() {
		return initialAttack;
	}

	public void setInitialDefense(Integer initialDefense) {
		this.initialDefense = initialDefense;
	}

	public Integer getInitialDefense() {
		return initialDefense;
	}

	public void setInitialInit(Integer initialInit) {
		this.initialInit = initialInit;
	}

	public Integer getInitialInit() {
		return initialInit;
	}
	public void restaureDefense(){
		defense=initialDefense;
	}
	public void restaureAttack(){
		attack=initialAttack;
	}
	public void restaureLifePoints(){
		lifePoints=initialLifePoints;
	}
	public void restaureInit(){
		init=initialInit;
	}

	public void setBlockedRegeneration(Boolean blockedRegeneration) {
		this.blockedRegeneration = blockedRegeneration;
	}

	public Boolean getBlockedRegeneration() {
		return blockedRegeneration;
	}

	
}
